home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 32
/
Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso
/
Aminet
/
dev
/
lang
/
Python151_Src.lha
/
Python1.5_Source
/
Python
/
hypot.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-14
|
355b
|
29 lines
/* hypot() replacement */
#include "config.h"
#include "myproto.h"
#include "mymath.h"
double hypot Py_PROTO((double x, double y));
double hypot(x, y)
double x;
double y;
{
double yx;
x = fabs(x);
y = fabs(y);
if (x < y) {
double temp = x;
x = y;
y = temp;
}
if (x == 0.)
return 0.;
else {
yx = y/x;
return x*sqrt(1.+yx*yx);
}
}